#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：turbo 
@File    ：urls.py
@Author  ：赵加响
@Date    ：2023/4/21 15:25 
@Desc    ：
"""
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from apps.accounts.views import UserViewSet, ResetPassword, SystemSettingsViewSet, UserMenuPermission, UserInfoViewSet, \
    UpdatePassword, UpdateAvatar, LogsDirectoryStructure, LogFileHandle, LogFileStream, DownloadLogFile, DeleteLogFile, \
    DeleteLogFolder

account_router = DefaultRouter()
account_router.register('list', UserViewSet, basename='User List')

account_info_router = DefaultRouter()
account_info_router.register('info', UserInfoViewSet, basename='User Info List')

account_urlpatterns = [
    path('', include(account_router.urls)),
    path('', include(account_info_router.urls)),
    path('reset_password/', ResetPassword.as_view()),
    path('update_password/', UpdatePassword.as_view()),
    path('update_avatar/', UpdateAvatar.as_view()),
    path('menu_permission/', UserMenuPermission.as_view()),
]

system_settings_router = DefaultRouter()
system_settings_router.register('list', SystemSettingsViewSet, basename='System Settings List')

system_settings_urlpatterns = [
    path('', include(system_settings_router.urls)),
    path('logs_directory_structure/', LogsDirectoryStructure.as_view()),
    path('logs_file_handles/', LogFileHandle.as_view()),
    path('log_file_stream/<str:folder>/<str:filename>/', LogFileStream.as_view(), name='log_file_stream'),
    path('download_log_file/', DownloadLogFile.as_view()),
    path('delete_log_file/', DeleteLogFile.as_view()),
    path('delete_log_folder/', DeleteLogFolder.as_view()),
]
